<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<EndpointListViewData>" %>
<%@ Import Namespace="SimpleServiceBus.EndpointManagement.Wcf.Contracts.Data"%>
<%@ Import Namespace="SimpleServiceBus.EndpointMonitor.Web.Models"%>
<%@ Import Namespace="SimpleServiceBus.EndpointMonitor.Web.Helpers"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	List
</asp:Content>
<asp:Content ID="refresh" ContentPlaceHolderID="HeaderContent" runat="server">
<meta http-equiv="refresh" content="30">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <style type="text/css">
 .endpointListName
 {
     font-size:1.5em;
     font-weight:bold;
     font-family:Arial;
 }
 
 .endpointStatusCell
 {
     /*
     background-color:#EEEEEE;
     */
 }
 
 .endpointStatusRow
 {
     /*
     background-color:#EEEEDD;
     */
 }
 </style>
 <div class="dualCol1">
 <table>
        <thead>
            <tr>               
                <td>
                    Endpoint
                </td>
                <td>
                    Last Update
                </td>
                <td>
                    Status
                </td>
            </tr>
        </thead>
        <tbody>
        <%
            foreach (ManagedEndpointContract endpoint in ViewData.Model.Endpoints)
            {
        %>
                <tr class="endpointStatusRow">                   
                    <td class="endpointListName">
                        <a href="<%=Url.EndpointLink(endpoint)%>">
                        <%=endpoint.EndpointDisplayName()%>
                        </a>
                    </td>
                    <td>
                        <%=endpoint.LastStatusUpdate.Value.ToLocalTime() %>
                    </td>
                    <td class="endpointStatusCell">
                        <%=Html.EndpointStatusImage(endpoint)%>
                    </td>
                </tr>
         <%
            }  
         %>
        </tbody>
    </table>
    </div>
    <div class="dualCol2">
    <h3>Recent Errors</h3>
        <%Html.RenderPartial("ErrorList",new EndpointErrorListViewData{Errors=ViewData.Model.RecentErrors,HideErrorMessagePreview = true}); %>
    </div>
</asp:Content>
